Skip to content

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Nov 25, 2024

We should compare the block memory allocation range, not the block metadata pointer (See zend_mm_add_huge_block).
This caused random test failure for ext/ffi/tests/gh14626.phpt when the malloc() performed by the FFI code lies close to the block metadata, and the size of the block is large enough.

This random crash was reported by #16902 (comment)
It only reproduced on 32-bit in like 1/12 tries on average on my system, so a bit hard to reproduce. Did not test on 64-bit but probably even harder to reproduce.

We should compare the block memory, not the block metadata (See
zend_mm_add_huge_block).
This caused random test failure for ext/ffi/tests/gh14626.phpt when the
malloc() performed by the FFI code lies close to the block metadata, and
the size of the block is large enough.

This was reported by php#16902 (comment)
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right of curse. Thanks!

@nielsdos nielsdos closed this in 18674e3 Nov 26, 2024
charmitro pushed a commit to wasix-org/php that referenced this pull request Mar 13, 2025
We should compare the block memory, not the block metadata (See
zend_mm_add_huge_block).
This caused random test failure for ext/ffi/tests/gh14626.phpt when the
malloc() performed by the FFI code lies close to the block metadata, and
the size of the block is large enough.

This was reported by php#16902 (comment)

Closes phpGH-16938.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants